import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.config.productionTip = false

//  创建一个全局自定义指令
Vue.directive('permissions', {
  //  当插入到页面时
  inserted(el) {
    const role = localStorage.getItem('role')
    if (role !== 'admin') {
      el.remove()
    }
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
